<template>
  <div class="popup">
    <div class="popup-content">
      <p>{{ message }}</p>
      <p v-if="errorMessage">{{ errorMessage }}</p> <!-- 显示错误信息 -->
      <button @click="handleConfirm">确认</button>
    </div>
  </div>
</template>

<script>
export default {
  name:'poPup',
  props: {
    message: String,
    errorMessage: String // 接收错误信息
  },
  methods: {
    handleConfirm() {
      this.$emit('confirm'); // 触发确认按钮点击事件
    }
  }
};
</script>

<style scoped>
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #ffffff;
  border: 1px solid #cccccc;
  padding: 20px;
  border-radius: 5px;
}

.popup-content {
  text-align: center;
}

.popup button {
  margin-top: 10px;
}
</style>
